package avicit.bdp.dms.dss.dto;

import avicit.bdp.common.service.dto.BdpColumnDTO;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Entity;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.List;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2021-04-06 16:37
 * @类说明：
 * @修改记录：
 */
@Entity
public class CommonTableDto implements Serializable, Comparable<CommonTableDto> {

    private static final long serialVersionUID = 1L;

    private String id;

    @ApiModelProperty(value = "是否展开 0-否 1-是")
    private Integer unfolded;

    @ApiModelProperty(value = "是否末级节点 0-否 1-是")
    private Integer leaf;

    @ApiModelProperty(value = "排序")
    private Integer orderBy;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "父节点ID")
    private String parentId;

    @ApiModelProperty(value = "是否为表")
    private Integer tableFlag;

    @Transient
    private List<CommonTableDto> children;

    @Transient
    private List<BdpColumnDTO> columnList;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getUnfolded() {
        return unfolded;
    }

    public void setUnfolded(Integer unfolded) {
        this.unfolded = unfolded;
    }

    public Integer getLeaf() {
        return leaf;
    }

    public void setLeaf(Integer leaf) {
        this.leaf = leaf;
    }

    public Integer getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(Integer orderBy) {
        this.orderBy = orderBy;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public List<CommonTableDto> getChildren() {
        return children;
    }

    public void setChildren(List<CommonTableDto> children) {
        this.children = children;
    }

    public List<BdpColumnDTO> getColumnList() {
        return columnList;
    }

    public void setColumnList(List<BdpColumnDTO> columnList) {
        this.columnList = columnList;
    }

    public Integer getTableFlag() {
        return tableFlag;
    }

    public void setTableFlag(Integer tableFlag) {
        this.tableFlag = tableFlag;
    }

    @Override
    public int compareTo(CommonTableDto obj) {
        return this.name.compareTo(obj.getName());
    }

}
